package com.ming.interview;

import java.util.Scanner;

/**
 * @Description 题目：求s=a+aa+aaa+aaaa+aa…a的值，其中a是一个数字。例如2+22+222+2222+22222(此时共有5个数相加)，几个数相加有键盘控制。输出结果的形式如：2+22+222=246；
 * @Author ye.ming
 * @Date Created in 2019/8/26
 */
public class Main7 {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int n = sc.nextInt();
        int sum = a;
        int temp = a;
        if (a < 1 || a > 9 || n < 1) {
            System.out.println("参数错误！");
        }
        StringBuilder sb = new StringBuilder();
        sb.append(a);
        for (int i = 1; i < n; i++) {
            temp = (int) (a * Math.pow(10,i) + temp);
            sum = sum + temp;
            sb.append("+" + temp);
        }
        sb.append("=" + sum);
        System.out.println(sb.toString());
        sc.close();

    }

//
//    private static int m1(int a, int n) {
//
//    }


}
